const CryptoJS = require('crypto-js');  //引用AES源码js
const AES ={}
//解密方法
AES.Decrypt = function Decrypt(word) {
    var key = CryptoJS.enc.Utf8.parse("http://cenozoncn");
    var decrypt = CryptoJS.AES.decrypt(word, key, {mode:CryptoJS.mode.ECB,padding: CryptoJS.pad.Pkcs7});
    return CryptoJS.enc.Utf8.stringify(decrypt).toString();
}

// 加密方法two
AES.Encrypt = function Encrypt(word) {
    var key = CryptoJS.enc.Utf8.parse("http://cenozoncn");
    var srcs = CryptoJS.enc.Utf8.parse(word);
    var encrypted = CryptoJS.AES.encrypt(srcs, key, {mode:CryptoJS.mode.ECB,padding: CryptoJS.pad.Pkcs7});
    return encrypted.toString();
}
export default AES